

/*******************************************************
*  Team name: FTPMP
*  Class involved: mainFrame, GameSettingWindow, RoundWindow
*  Version, Author, History of modification:
*  Ver 1.0, Ada Ko,
*  		- add mainFrame() 
*  Ver 1.1, Fred,
*  		- add Window builder to configure the display
*******************************************************/

package boundary;

import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Dimension;
import java.awt.EventQueue;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import boundary.*;
import javax.swing.JButton;

import control.BoardEngine;

import java.awt.event.MouseAdapter;
import java.awt.Font;

public class mainFrame extends JFrame 
{

	private JPanel contentPane;
	private GameSettingWindow settingWindow;
	private RoundWindow roundWindow;
	private BoardEngine BE;
	private CardLayout cl_contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) 
	{
		EventQueue.invokeLater(new Runnable() 
		{
			public void run() {
				try {
					mainFrame frame = new mainFrame();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public mainFrame() 
	{
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(0, 0, 1024,768);
		setPreferredSize(new Dimension(1024,768));
		setResizable(false); 
		contentPane = new JPanel();
		contentPane.setPreferredSize(new Dimension(1024,768));
		contentPane.setLayout(new CardLayout(0, 0));
		setContentPane(contentPane);
		cl_contentPane=(CardLayout)(contentPane.getLayout());
		BE=new BoardEngine();
		settingWindow=new GameSettingWindow(contentPane,cl_contentPane,BE);
		roundWindow=new RoundWindow(cl_contentPane,BE);
		BE.initActionWindow(roundWindow);
		contentPane.add(settingWindow, "settingWindow");
		contentPane.add(roundWindow, "roundWindow");
		cl_contentPane.addLayoutComponent(settingWindow, "settingWindow");
		cl_contentPane.addLayoutComponent(roundWindow, "roundWindow");
		cl_contentPane.show(contentPane, "settingWindow");
	}
	
	public GameSettingWindow getGSWindow()
	{
		return this.settingWindow;
	}
	public RoundWindow getRW()
	{
		return this.roundWindow;
	}
	public BoardEngine getBE()
	{
		return this.BE;
	}
}
